﻿using Mesuro.Common;
using System.Windows;
using System;

namespace Mesuro.Graphing {
	public class LinearScale : DependencyObject, IScale {
		private Limits range = new Limits(), domain = new Limits();
		//DATA-SPACE:
		public Limits Range {
			get { return range; }
			set { range = value; }
		}
		//PLOT-SPACE:
		public Limits Domain {
			get { return domain; }
			set { domain = value; }
		}

		public double ToDataSpace( double d ) {
			return Range.Min + Domain.Ratio( d ) * Range.Range;
		}

		public double ToPlotSpace( double d ) {
			return Domain.Min + Range.Ratio( d ) * Domain.Range;
		}
	}

}
